#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
#include <string.h>

int My_strcmp(char* arr1, char* arr2)
{
	assert(arr1 && arr2);
	while (*arr1 == *arr2)
	{	
		if (*arr1 == '\0')
			return 0;
		arr1++;
		arr2++;
		
	}
	return *arr1 - *arr2;
}

char* My_strstr(char* arr1, char* arr2) 
{
	const char* s1 = NULL;
	const char* s2 = NULL;
	const char* ret = arr1;

	if (*arr2 == '\0')
		return (char*)arr1;
	
	while(*ret)
	{
	s1 = ret;
	s2 = arr2; 
	while (*s1 == *s2 && *s1 != '\0' && *s2 != '\0')
	{
			s1++;
			s2++;
		}
		if (*s2 == '\0') {
			return ret;
		}
		ret++;
		
	}
	return NULL;
}

int main()
{	
	char a1[] = "Hello";
	char a2[] = "He";
	int res1 = My_strcmp(a1, a2);
	printf("%d\n", res1);
	char* p = My_strstr(a1, a2);
	printf("%s", p);
	return 0;
}